<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Packing List and Labels</title>
</head>
<body>
<h3> Print Packing List and Labels</h3>
<?php
date_default_timezone_set('Australia/Melbourne');
$dateToday = date("Y_m_d");
$csvsfolder = "./csvs/";
$shopFileName="./settings/shops.txt";

$fl=fopen($shopFileName,"r");
$contents = fread($fl, filesize($shopFileName));
fclose($fl);
$shopArr = explode(",",$contents);
foreach( $shopArr as $key => $value){
$fileNameCsv = trim($value)."_".$dateToday.".csv";
if(file_exists($csvsfolder.$fileNameCsv)){
	echo "<h3>$value</h3>";
	echo "<a href=\"./pickupsummary.php?filename=$fileNameCsv\" target=\"_blank\"> Pickup Summary</a> |<a href=\"./postslip.php?filename=$fileNameCsv\" target=\"_blank\"> Packing Slip</a> | <a href=\"./eb.php?filename=$fileNameCsv\" target=\"_blank\"> Label</a>";
	echo "<br /><br />";	
	}	
else{
	
	echo "<br />$fileNameCsv Not Exist<br />";
	}		
	}
?>
</body>
</html>